<?php
class TelefoneC extends CI_Controller {

	public function __construct( ) {
		parent::__construct( );
		
		$this->load->model('telefone');
		
		if (!isset($_SESSION))
			session_cache_expire(500);
		session_start();
	}
	
	public function ajaxRecuperar(){
		$id = (int)$this->input->post("id");
		
		$busca = array("tel_usuario"=>$id);
		$telefone = $this->telefone->buscar($busca);
		if ($telefone){
			
			$resp['telId']     = $telefone['tel_id'];
			$resp['telNumero'] = $telefone['tel_numero'];
			$resp['telContato']= $telefone['tel_contato'];

			
			echo json_encode ( $resp );
		}
	}
	
}